package com.youkeyi.ddy.cloud.common.api.application.system.corp;

import com.youkeyi.ddy.cloud.common.api.application.system.corp.dto.SystemCorpListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.corp.dto.SystemCorpUserListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.corp.param.*;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统主体
 *
 * @Corpor liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】corp management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemCorpCloudServiceFallback.class)
@RequestMapping("/system/corp")
public interface SystemCorpCloudService {

    // 查询主体列表
    @ApiOperation(value = "Query System Corp List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemCorpListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Corp List", dataType = "SystemCorpListCloudParam", dataTypeClass = SystemCorpListCloudParam.class),
    })
    @GetMapping
    public abstract SystemCorpListCloudDto list(SystemCorpListCloudParam param);

    // 查询主体列表
    @ApiOperation(value = "Query System Finance Corp List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.financeList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemCorpListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Finance Corp List"),
    })
    @GetMapping("/finance/corp")
    public abstract SystemCorpListCloudDto financeList();

    // 创建主体
    @ApiOperation(value = "Create System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Corp", dataType = "SystemCorpCreateCloudParam", dataTypeClass = SystemCorpCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemCorpCreateCloudParam param);


    // 编辑主体
    @ApiOperation(value = "Update System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Corp", dataType = "SystemCorpUpdateCloudParam", dataTypeClass = SystemCorpUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemCorpUpdateCloudParam param);


    // 删除主体
    @ApiOperation(value = "Delete System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Corp", dataType = "SystemCorpDeleteCloudParam", dataTypeClass = SystemCorpDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemCorpDeleteCloudParam param);





    // 查询人事主体与其他主体的映射关系列表
    @ApiOperation(value = "Query Hr Corp Mapping List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.hrMappingList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemCorpListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Hr Corp Mapping List"),
    })
    @GetMapping("/hr/corp/mapping")
    public abstract SystemCorpListCloudDto hrMappingList(SystemHrCorpMappingListCloudParam param);

    // 编辑人事主体与其他主体的映射关系
    @ApiOperation(value = "Update Hr Corp Mapping", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.hrMappingUpdate")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Hr Corp Mapping", dataType = "SystemHrCorpMappingUpdateCloudParam", dataTypeClass = SystemHrCorpMappingUpdateCloudParam.class),
    })
    @PatchMapping("/hr/corp/mapping")
    public abstract ResponseContent hrMappingUpdate(@RequestBody SystemHrCorpMappingUpdateCloudParam param);




    // 查询主体用户列表
    @ApiOperation(value = "Query System Corp User List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.userList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemCorpUserListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Corp User List", dataType = "SystemCorpListCloudParam", dataTypeClass = SystemCorpListCloudParam.class),
    })
    @GetMapping("/user")
    public abstract SystemCorpUserListCloudDto userList(SystemCorpListCloudParam param);

    // 查询主体用户列表
    @ApiOperation(value = "Query Mapping Corp User List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.corp.SystemCorpCloudService.mappingCorpUserList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemCorpUserListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Mapping Corp User List", dataType = "SystemCorpListCloudParam", dataTypeClass = SystemCorpListCloudParam.class),
    })
    @GetMapping("/mapping/user")
    public abstract SystemCorpUserListCloudDto mappingCorpUserList(SystemCorpListCloudParam param);

}
